#include "./stm32f1xx_it.h"
#include "./SYSTEM/sys/sys.h"
#include "./SYSTEM/usart/usart.h"
#include "./SYSTEM/delay/delay.h"
#include "./BSP/LED/led.h"
#include "./BSP/OLED/OLED.h"
#include "./BSP/ESP8266/ESP8266.h"
#include "./BSP/SHT20/sht20.h"
uint8_t ret;

float Humidity,Temperature;  

int main(void)
{
    HAL_Init();                         /* HAL库初始化 */
    sys_stm32_clock_init(RCC_PLL_MUL9); /* 设置时钟, 72Mhz */
    delay_init(72);                     /* 延时初始化 */
    led_init();                         /* 初始化LED */
    OLED_Init();
    usart1_init(115200);
    //usart3_init(115200);
    MyI2C_Init();
    OLED_Printf(0, 1, OLED_8X16, "OLED");
    OLED_Update();
    while (1)
    {
        Temperature = ReadSht20(0xf3);	       //读取湿度
		Humidity = ReadSht20(0xf5);	   //读取温度	
        OLED_Printf(0,16,OLED_8X16,"%.2f",Temperature);
        OLED_Printf(0,32,OLED_8X16,"%.2f",Humidity);
        OLED_Update();

        UART_printf(&g_uart3_handle,"ESP8266\r\n");
        delay_ms(1000);
    }
}
